<?php defined('InShopNC') or exit('Access Invalid!');?>

<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <h3><?php echo $lang['activity_index_manage'];?></h3>
     
    </div>
  </div>
  <div class="fixed-empty"></div>
  <form id="add_form" method="post" enctype="multipart/form-data">
    <input type="hidden" name="form_submit" value="ok" />
    
    <table class="table tb-type2">
      <tbody>
           
        <tr>
          <td colspan="2" class="required"><label class="validation" for="activity_start_date">
          开始时间:</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" id="activity_start_date" class="txt date" name="exchange_start_date" value="<?php echo date('Y-m-d',$output['activity']['exchange_start_date']);?>"/></td>
          <td class="vatop tips"></td>
          
          <tr>
          <td colspan="2" class="required"><label class="validation" for="activity_start_date">
        结束时间:</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" id="activity_end_date" class="txt date" name="exchange_end_date" value="<?php echo date('Y-m-d',$output['activity']['exchange_end_date']);?>"/></td>
          <td class="vatop tips"></td>
          
        </tr>   
        
         <tr>
          <td colspan="2" class="required"><label class="validation" for="activity_start_date">
        规则:</label></td>
         </tr>

        <tr>
          <td colspan="3"  ><?php showEditor('comments',$output['activity']['comments'],'600px','400px','visibility:hidden;',"false",$output['editor_multimedia']);?></td>
        </tr>
        
        <tr>
          <td colspan="2" class="required"><label class="validation"  for="activity_sort">优惠券选择:</label></td>
        </tr>
         <tr class="noborder">
          <td class="vatop rowform"><select name="goods_id" id="goods_id">
              <?php if(!empty($output['voucher_list']) && is_array($output['voucher_list'])){ ?>
              <?php foreach($output['voucher_list'] as $k => $v){ ?>
              <option <?php if($output['gift']['goods_id'] == $v['voucher_t_id']){ ?>selected='selected'<?php } ?> value="<?php echo $v['voucher_t_id'];?>"><?php echo $v['voucher_t_title'].' : '.$v['voucher_t_desc'];?></option>
              <?php } ?>
              <?php } ?>
            </select></td>
          <td class="vatop tips"><?php echo $lang['goods_class_add_sup_class_notice'];?></td>
        </tr>
        
       
        <!-- <tr class="noborder">
          <td><textarea rows="18" cols="58" name="comments" style="height: 160px;"><?php echo $output['activity']['comments'];?></textarea></td>
          <td class="vatop tips"></td>
          
        </tr>   --> 
            
        <!-- <tr>
          <td colspan="2" class="required"><label for="pic"><?php echo '推荐有奖图片';?>:</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><span class="type-file-box">
            <input type='text' name='textfield' id='textfield1' class='type-file-text' />
            <input type='button' name='button' id='button1' value='' class='type-file-button' />
            <input name="image" type="file" class="type-file-file" id="pic" size="30" hidefocus="true" nc_type="change_pic">
            </span> <img alt="" width="180" height="140" src="<?php echo UPLOAD_SITE_URL.'/'.ATTACH_ACTIVITY.'/'.$output['activity']['image'];?>"></td>
          <td class="vatop tips">推荐有奖主图</td>
        </tr> -->
     
      </tbody>
      <tfoot>
        <tr class="tfoot">
          <td colspan="2"><a  href="JavaScript:void(0);" class="btn" id="submitBtn"><span><?php echo $lang['nc_submit'];?></span></a></td>
        </tr>
      </tfoot>
    </table>
  </form>
</div>
<link type="text/css" rel="stylesheet" href="<?php echo RESOURCE_SITE_URL."/js/jquery-ui/themes/ui-lightness/jquery.ui.css";?>"/>
<script src="<?php echo RESOURCE_SITE_URL."/js/jquery-ui/jquery.ui.js";?>"></script> 
<script src="<?php echo RESOURCE_SITE_URL."/js/jquery-ui/i18n/zh-CN.js";?>" charset="utf-8"></script> 
<script type="text/javascript">

$(function(){
	$("#submitBtn").click(function(){//window.location.reload();
		if($("#add_form").valid()){
    		$("#add_form").submit();
		}
    	
    });
});

$(document).ready(function(){
	$("#activity_start_date").datepicker({dateFormat: 'yy-mm-dd'});
	$("#activity_end_date").datepicker({dateFormat: 'yy-mm-dd'});
});

</script>